import request from '@/utils/request'

// 查询传感器类型列表
export function listSensorType(query) {
  return request({
    url: '/admin-api/business/sensorType/list',
    method: 'get',
    params: query
  })
}

// 一级目录
export function listTypeLevel1() {
  return request({
    url: '/admin-api/business/sensorType/list/level1',
    method: 'get'
  })
}

// 通过一级找二级
export function listTypeLevel2(sensorTypeId) {
  return request({
    url: '/admin-api/business/sensorType/list/level2/' + sensorTypeId,
    method: 'get'
  })
}

export function allSensorType() {
  return request({
    url: '/admin-api/business/sensorType/all',
    method: 'get'
  })
}

// 查询传感器类型详细
export function getSensorType(sensorTypeId) {
  return request({
    url: '/admin-api/business/sensorType/' + sensorTypeId,
    method: 'get'
  })
}

// 新增传感器类型
export function addSensorType(data) {
  return request({
    url: '/admin-api/business/sensorType',
    method: 'post',
    data: data
  })
}

// 修改传感器类型
export function updateSensorType(data) {
  return request({
    url: '/admin-api/business/sensorType',
    method: 'put',
    data: data
  })
}

// 删除传感器类型
export function delSensorType(sensorTypeId) {
  return request({
    url: '/admin-api/business/sensorType/' + sensorTypeId,
    method: 'delete'
  })
}
